package com.yc.bbs.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.stereotype.Service;

@Service
public class MailBiz {

    @Autowired
    MailSender mailSender;

    public void sendSimpleMail(String title, String from, String to, String content) {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setSubject(title);
        message.setFrom(from);
        message.setTo(to);
        message.setText(content);
        mailSender.send(message);
    }
}
